package com.baobao.domain;

import java.io.Serializable;

import java.util.Calendar;

import javax.persistence.Id;

import javax.persistence.*;

/**
 */
public class NoticePK implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	public NoticePK() {
	}

	/**
	 */

	@Column(name = "school_id", length = 40, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public String schoolId;
	/**
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "time", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	public Calendar time;

	/**
	 */
	public void setSchoolId(String schoolId) {
		this.schoolId = schoolId;
	}

	/**
	 */
	public String getSchoolId() {
		return this.schoolId;
	}

	/**
	 */
	public void setTime(Calendar time) {
		this.time = time;
	}

	/**
	 */
	public Calendar getTime() {
		return this.time;
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((schoolId == null) ? 0 : schoolId.hashCode()));
		result = (int) (prime * result + ((time == null) ? 0 : time.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof NoticePK))
			return false;
		NoticePK equalCheck = (NoticePK) obj;
		if ((schoolId == null && equalCheck.schoolId != null) || (schoolId != null && equalCheck.schoolId == null))
			return false;
		if (schoolId != null && !schoolId.equals(equalCheck.schoolId))
			return false;
		if ((time == null && equalCheck.time != null) || (time != null && equalCheck.time == null))
			return false;
		if (time != null && !time.equals(equalCheck.time))
			return false;
		return true;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder("NoticePK");
		sb.append(" schoolId: ").append(getSchoolId());
		sb.append(" time: ").append(getTime());
		return sb.toString();
	}
}
